#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<set>
#include<queue>
using namespace std;

const int maxn = 10000 + 10;
const int maxm = 20000 + 10;

int N, M;
set<int> nextNodes[maxn];
int inDegree[maxn];
bool uncertain, conflict;
int father[maxn];

void init(){
	for(int i = 0; i < maxn; i ++){
		nextNodes[i].clear();
		father[i] = i;
	}
	memset(inDegree, 0, sizeof(int) * maxn);
	uncertain = false;
	conflict = false;
}

int getFather(int a){
	if(father[a] == a){
		return a;
	}else{
		father[a] = getFather(father[a]);
		return father[a];
	}
}

void uniSet(int a, int b){
	int fa = getFather(a);
	int fb = getFather(b);
	if(fa != fb){
		father[fa] = fb;
	}
}

void solve(){
	queue<int> q;
	for(int i = 0; i < N; i ++){
		if(getFather(i) == i && inDegree[i] == 0){
			q.push(i);
		}
	}
	while(!q.empty()){
		if(q.size() > 1){
			uncertain = true;
		}
		int node = q.front();
		q.pop();
		set<int>::iterator it;
		for(it = nextNodes[node].begin(); it != nextNodes[node].end(); it ++){
			inDegree[*it] --;
			if(inDegree[*it] == 0){
				q.push(*it);
			}
		}
	}

	for(int i = 0; i < N; i ++){
		if(getFather(i) == i && inDegree[i] > 0){
			conflict = true;
		}
	}
}


void printAns(){
	if(conflict){
		printf("CONFLICT\n");
	}else if(uncertain){
		printf("UNCERTAIN\n");
	}else{
		printf("OK\n");
	}
}

int main(void){
	//freopen("1811.txt", "r", stdin);
	while(scanf("%d%d", &N, &M) == 2){
		init();

		int relationA[maxm];
		char relationOper[maxm][10];
		int relationB[maxm];

		char aStr[20], bStr[20];
		for(int i = 0; i < M; i ++){
			scanf("%s%s%s", aStr, relationOper[i], bStr);
			sscanf(aStr, "%d", &relationA[i]);
			sscanf(bStr, "%d", &relationB[i]);
		}

		for(int i = 0; i < M; i ++){
			if(relationOper[i][0] == '='){
				uniSet(relationA[i], relationB[i]);
			}
		}

		for(int i = 0; i < M; i ++){
			int a = getFather(relationA[i]);
			int b = getFather(relationB[i]);
			if(relationOper[i][0] == '<'){
				if(nextNodes[a].count(b) == 0){
					nextNodes[a].insert(b);
					inDegree[b] ++;
				}
			}else if(relationOper[i][0] == '>'){
				if(nextNodes[b].count(a) == 0){
					nextNodes[b].insert(a);
					inDegree[a] ++;
				}
			}
		}
		solve();
		printAns();
	}
	return 0;
}
